<template>
  <div class="box7">
    <div class="title">
      <p>年度游客量对比</p>
      <img src="../../images/dataScreen-title.png" alt="" />
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script setup lang="ts">
import * as echarts from "echarts";
import { ref, onMounted } from "vue";
//获取dom节点
let charts = ref();
onMounted(() => {
  //一个容器展示多种图形图表
  let mychart = echarts.init(charts.value);
  mychart.setOption({
    title: {
      text: "散点图",
      left:'40%',
      textStyle: {
        color:'white'
      },
    },
    xAxis:{
      type:'category'
    },
    yAxis:{
      show:false
    },
    grid:{
      left:20,
      top:20,
      right:0,
      bottom:20
    },
    series:{
      type:'scatter',
      data:[33,88,21,9,788,234],
      symbol:'arrow',
      symbolSize:16,
      //图文标签
      label:{
        show:true,
        position:'top',
        color:'yellowgreen'
      }
    }
  });
});
</script>

<style scoped lang="scss">
.box7 {
  width: 100%;
  height: 100%;
  background: url(../../images/dataScreen-main-lb.png) no-repeat;
  background-size: 100% 100%;
  margin: 20px 0px;
  .title {
    margin-left: 20px;
    p {
      color: white;
      font-size: 20px;
    }
  }
  .charts {
    height: calc(100% - 30px);
  }
}
</style>
